home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 020 / modula.arc / SCREEN.DEF < prev    next >
Encoding:
Modula Definition  |  1986-08-20  |  4.0 KB  |  124 lines

  1.  
  2. DEFINITION MODULE PcScreen;
  3.  
  4. (*
  5. Author:     John Tal  02/27/86 (Southfield, MI)
  6.             Inspired by John Beidler & Paul Jockowitz
  7.             (University of Scranton)
  8.             Format for Color Support Inspired by
  9.               Ian Mackay of Computer Methods Canada
  10.  
  11. Updated:    Donald Dumitru   03/18/86 to work under ITC's SDS
  12. Updated:    John Tal         04/02/86 implementing Donald's changes into
  13.                                       Logitech Version.
  14. Updated:    Richard Polunsky 04/08/86 to correct attribute list
  15.                                       and do hardware detection
  16. Updated:    John Tal         04/08/86 implementing Richard's changes into
  17.                                       Logitech Version.
  18.                                       Added Color support.
  19. Updated:    John Tal         04/15/86 Changes required for developing
  20.                                       TextWindows module.
  21.  
  22.                              04/16/86 Made major changes in determining
  23.                                       color attributes which makes this
  24.                                       version now much different than
  25.                                       what was co-developed with ITC's
  26.                                       SDS.
  27.                                       Eliminated numbers for colors and
  28.                                       substituted words instead.
  29.                                       This required creating a unique
  30.                                       code sheme which is not compatible
  31.                                       with standard IBM Basica Color
  32.                                       Statements.
  33.                                       This was done in-part to enhance our
  34.                                       move into other environments.
  35.  
  36. *)
  37.  
  38. FROM SYSTEM IMPORT ADDRESS;
  39.  
  40.  
  41. (* Attributes in all lowercase are color foreground
  42.        "       "  "  uppercase are color background
  43.    Attributes with first letter uppercase are Monochrome attributes
  44. *)
  45.  
  46. EXPORT QUALIFIED
  47.   black,blue,green,cyan,red,magenta,brown,ltgrey,
  48.   dkgrey,ltblue,ltgreen,ltcyan,ltred,ltmagenta,yellow,white,
  49.  
  50.   BLACK,BLUE,GREEN,CYAN,RED,MAGENTA,YELLOW,WHITE,BLINK,
  51.  
  52.   Invisible,Bold,Highlight,Light,Italic,Underline,Outline,Shadow,
  53.   Blink,Reverse,Normal,
  54.  
  55.   Cls, EraseLine, DisplayString, DisplayStringMid, WriteScreenChar,
  56.   ReadScreenChar, WriteScreenCol, ReadScreenCol;
  57.  
  58. CONST
  59. (* color support usage    ex.   White characters on a Red background
  60.                                 DisplayString(1,1,white+RED,'Hi Ma!');
  61. *)
  62. (* ----  foreground  ---- *)
  63.  black     = 0H;
  64.  blue      = 01H;
  65.  green     = 02H;
  66.  cyan      = 03H;
  67.  red       = 04H;
  68.  magenta   = 05H;
  69.  brown     = 06H;
  70.  ltgrey    = 07H;
  71.  dkgrey    = 08H;
  72.  ltblue    = 09H;
  73.  ltgreen   = 0AH;
  74.  ltcyan    = 0BH;
  75.  ltred     = 0CH;
  76.  ltmagenta = 0DH;
  77.  yellow    = 0EH;
  78.  white     = 0FH;
  79. (* ----  background  ---- *)
  80.  BLACK   = 0H;
  81.  BLUE    = 10H;
  82.  GREEN   = 20H;
  83.  CYAN    = 30H;
  84.  RED     = 40H;
  85.  MAGENTA = 50H;
  86.  YELLOW  = 60H;
  87.  WHITE   = 70H;
  88.  BLINK   = 80H;
  89.  
  90. (* defined by JTal to be de-coded by PcScreen
  91.    example:  DisplayString(10,4,Blink+Underline,XStr[a]);
  92. *)
  93.  Invisible = 0;   (* PC *)
  94.  Bold      = 1;   (* GEM *)
  95.  Highlight = 1;   (* PC *)
  96.  Light     = 2;   (* GEM *)
  97.  Italic    = 4;   (* GEM *)
  98.  Underline = 8;   (* PC/GEM *)
  99.  Outline   = 16;  (* GEM *)
  100.  Shadow    = 32;  (* GEM *)
  101.  Blink     = 64;  (* PC *)
  102.  Reverse   = 128; (* PC *)
  103.  Normal    = 256; (* PC~GEM *)
  104.  
  105.  
  106. PROCEDURE Cls;
  107.  
  108. PROCEDURE EraseLine(Row : CARDINAL);
  109.  
  110. PROCEDURE DisplayString(Row,Col,Color : CARDINAL; Str : ARRAY OF CHAR);
  111.  
  112. PROCEDURE DisplayStringMid(Row,Col,Color : CARDINAL; Str : ARRAY OF CHAR;
  113.                            beg,len : CARDINAL);
  114.  
  115. PROCEDURE WriteScreenChar(Row,Col,Color : CARDINAL; Letter : CHAR);
  116.  
  117. PROCEDURE ReadScreenChar(Row,Col : CARDINAL) : CHAR;
  118.  
  119. PROCEDURE WriteScreenCol(Row,Col,Color : CARDINAL);
  120.  
  121. PROCEDURE ReadScreenCol(Row,Col : CARDINAL) : CARDINAL;
  122.  
  123. END PcScreen.
  124.